package edu.hawaii.wicket.page.energy;

import org.apache.wicket.ResourceReference;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.Model;

import edu.hawaii.wicket.page.BasePage;
import edu.hawaii.wicket.page.ac.ACPage;
import edu.hawaii.wicket.page.aquaponics.AquaponicsPage;
import edu.hawaii.wicket.page.lighting.LightingPage;
import edu.hawaii.wicket.page.security.SecurityPage;


/**
 * The application home page.  This page illustrates links. 
 * @author Philip Johnson
 */
public class EnergyPage extends BasePage {
  private static final ResourceReference SIDE_BAR = new ResourceReference(
        EnergyPage.class,"side-bar.png");
  private static final ResourceReference LOGO = new ResourceReference(
        EnergyPage.class,"logo.png");
  private static final ResourceReference energy = new ResourceReference(
      EnergyPage.class,"energy_monitor.png");
  
  /** Support serialization. */
  private static final long serialVersionUID = 1L;
  
  /**
   * The home page for this application.  In this example, all of the material for the home
   * page is provided in the BasePage class, the BasePage.html file, and the HomePage.html file.
   * 
   */
  public EnergyPage() {
    add(new Image("energy_monitor", new Model<ResourceReference>(energy)));
    add(new Image("sidebar", new Model<ResourceReference>(SIDE_BAR)));
    add(new Image("logo", new Model<ResourceReference>(LOGO)));
    add(new Link<String>("LightPageLink") {
      private static final long serialVersionUID = 1L;
      /** Upon clicking this link, go to HomePage. */
      @Override
      public void onClick() {
        setResponsePage(new LightingPage());
      }
      }
    );
    
    add(new Link<String>("ACPageLink") {
      private static final long serialVersionUID = 1L;
      /** Upon clicking this link, go to ListPage. */
      @Override
      public void onClick() {
        setResponsePage(new ACPage());
      } 
      }
    );
    
    add(new Link<String>("SecurityPageLink") {
      private static final long serialVersionUID = 1L;
      /** Upon clicking this link, go to FormPage. */
      @Override
      public void onClick() {
        setResponsePage(new SecurityPage());
      }
      }
    );
    
    add(new Link<String>("AquaponicsPageLink") {
      private static final long serialVersionUID = 1L;
      /** Upon clicking this link, go to TablePage. */
      @Override
      public void onClick() {
        setResponsePage(new AquaponicsPage());
      }
      }
    );
  }
}
